﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package org.aswing.util {
    import flash.display.*;

    public class DepthManager {

        public static function bringToBottom(_arg1:DisplayObject):void{
            var _local2:DisplayObjectContainer = _arg1.parent;
            if (_local2 == null){
                return;
            };
            if (_local2.getChildIndex(_arg1) != 0){
                _local2.setChildIndex(_arg1, 0);
            };
        }
        public static function bringToTop(_arg1:DisplayObject):void{
            var _local2:DisplayObjectContainer = _arg1.parent;
            if (_local2 == null){
                return;
            };
            var _local3:int = (_local2.numChildren - 1);
            if (_local2.getChildIndex(_arg1) != _local3){
                _local2.setChildIndex(_arg1, _local3);
            };
        }
        public static function isTop(_arg1:DisplayObject):Boolean{
            var _local2:DisplayObjectContainer = _arg1.parent;
            if (_local2 == null){
                return (true);
            };
            return (((_local2.numChildren - 1) == _local2.getChildIndex(_arg1)));
        }
        public static function isBottom(_arg1:DisplayObject):Boolean{
            var _local2:DisplayObjectContainer = _arg1.parent;
            if (_local2 == null){
                return (true);
            };
            var _local3:int = _local2.getChildIndex(_arg1);
            if (_local3 == 0){
                return (true);
            };
            return (false);
        }
        public static function isJustBelow(_arg1:DisplayObject, _arg2:DisplayObject):Boolean{
            var _local3:DisplayObjectContainer = _arg1.parent;
            if (_local3 == null){
                return (false);
            };
            if (_arg2.parent != _local3){
                return (false);
            };
            return ((_local3.getChildIndex(_arg1) == (_local3.getChildIndex(_arg2) - 1)));
        }
        public static function isJustAbove(_arg1:DisplayObject, _arg2:DisplayObject):Boolean{
            return (isJustBelow(_arg2, _arg1));
        }

    }
}//package org.aswing.util 
